package ar.edu.uba.fi.jmit.aspecter.monitor.testUtils;

import java.util.LinkedList;
import java.util.List;
/**
 * Representa un Sender del proyecto Sender.
 * @author Tomas
 *
 */
public class SenderMock {
	
	private List<MockEvent> sendedEvents = new LinkedList<MockEvent>();
	
	private List<MockEvent> hpSendedEvents = new LinkedList<MockEvent>();

	public void send(MockEvent event) {
		sendedEvents.add(event);
	}
	
	public void send(MockEvent event, MessagePriorityMock messagePriority) {
		if(MessagePriorityMock.HIGH_PRIORITY.equals(messagePriority)) {
			hpSendedEvents.add(event);
		}else {
			sendedEvents.add(event);
		}
	}

	public List<MockEvent> getSendedEvents() {
		return sendedEvents;
	}
	
	public List<MockEvent> getHpSendedEvents() {
		return hpSendedEvents;
	}
	
	public List<MockEvent> getAllSendedEvents() {
		List<MockEvent> list = new LinkedList<MockEvent>();
		list.addAll(sendedEvents);
		list.addAll(hpSendedEvents);
		return list;
	}
}
